package com.blog.service.Impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.blog.entity.SysArticle;

import com.blog.mapper.SysArticleMapper;
import com.blog.service.SysArticleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author gxcc
 * @create 2021/9/30 23:00
 */
@Service
public class SysArticleServiceImpl extends ServiceImpl<SysArticleMapper,SysArticle> implements SysArticleService{

    @Resource
    SysArticleMapper articleMapper;

    @Override
    public List<SysArticle> getAll() {
        return articleMapper.selectList(null);
    }

    @Override
    public List<Map<String,Object>> queryArticleByCategory(String category) {
        return articleMapper.queryArticleByCategory(category);
    }

    @Override
    public List<Map<String,Object>> queryArticleByCondition(String articleTitle, String articleAuthor, String articleCategory) {
        Map<String,Object>  map = new HashMap<>();
        map.put("articleCategory",articleCategory);
        map.put("articleTitle",articleTitle);
        map.put("articleAuthor",articleAuthor);
        return articleMapper.queryArticleByCondition(map);
    }

    @Override
    public Map<String, Object> queryArticleCount(Map<String,Object> map) {
        return articleMapper.queryArticleCount(map);
    }

    @Override
    public List<Map<String, Object>> queryArticleIndex(Map<String, Object> map) {
        return articleMapper.queryArticleIndex(map);
    }

    @Override
    public List<Map<String, Object>> queryArticleHistory() {
        return articleMapper.queryArticleHistory();
    }

    @Override
    public List<Map<String, Object>> queryAllArticle() {
        return articleMapper.queryAllArticle();
    }

    @Override
    public List<Map<String, Object>> queryArticleDetailByNum(String articleNum) {
        return articleMapper.queryArticleDetailByNum(articleNum);
    }

    @Override
    public List<Map<String, Object>> queryAllArticleByTitle(String selectInput) {
        return articleMapper.queryAllArticleByTitle(selectInput);
    }

    @Override
    public List<Map<String, Object>> tableList() {
        return articleMapper.tableList();
    }
}
